dim args :args =inputbox("seacrch refdes =?",args,"")
searchValue = ucase(trim(args))
if searchValue<>"" then
	dim doc
	set doc = Application.ActiveDocument
	doc.SelectObjects ppcbObjectTypeAll, "*", False  
	doc.SelectObjects(1,searchValue,True) 
	dim v
	set v = doc.ActiveView
	v.SetExtentsToSelection
	
	' dim compobj
	' set compobj = doc.Components(searchValue)
	' if compobj is nothing then
		' msgbox "nothing found!"
	' else			
		' dim ocmd,target
		' target = "Z"
		' ocmd = "Z " & cint(compobj.layer)
		' 'create file
		' Dim fileContent
		' fileContent = "Application.ModelessCommand("""& target &""")" & chr(13) & chr(10)
		' fileContent = fileContent & "DlgModelessCmd.Command = " & chr(34) & ocmd & chr(34) & chr(13) & chr(10)
		' fileContent = fileContent & "DlgModelessCmd.OnOk()"		
		
		' dim tempFile
		' tempFile = application.activedocument.path & "\tmp1.mcr"
		' Dim fso,fw
		' Set fso = CreateObject("Scripting.FileSystemObject")
		' set fw = fso.createtextfile(tempFile, True)
		' fw.write fileContent
		' fw.close
		' set fw = nothing
		' Application.RunMacro(tempFile)
		' fso.deletefile(tempFile,true)
		' set fso =nothing
		
		' compobj.selected = true
		' Application.ExecuteCommand("Zoom To Selection")
	'end if
end if
